package com.java.manage.controller;

import com.java.common.model.Result;
import com.java.manage.model.AccessoriesType;
import com.java.manage.model.Color;
import com.java.manage.service.AccessoriesTypeService;
import com.java.manage.service.ColorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/accessoriesType")
public class AccessoriesTypeController {
    //配件分类管理
    @Autowired
    private AccessoriesTypeService accessoriesTypeService;

    @PostMapping("/list")
    public Result list(@RequestBody AccessoriesType accessoriesType) {
        return accessoriesTypeService.list(accessoriesType);
    }

    @PostMapping("/save")
    public Result save(@RequestBody AccessoriesType accessoriesType) {
        return accessoriesTypeService.save(accessoriesType);
    }

    @PostMapping("/modify")
    public Result modify(@RequestBody AccessoriesType accessoriesType) {
        return accessoriesTypeService.modify(accessoriesType);
    }

    @PostMapping("/remove")
    public Result remove(int[] ids) {
        return accessoriesTypeService.remove(ids);
    }
    /**
     * 查询类型
     * @return
     */
    @PostMapping("/listAccessType")
    public Result listAccessType() {
        return accessoriesTypeService.listAccessType();
    }
}
